package com.mxpio.erp.common.hr.entity;

import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.Dept;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_HR_ATTENDANCE_MONTH")
@Schema(description="员工月度考勤汇总")
public class AttendanceMonth extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Id
    @Generator
    @Column(name = "ID_", updatable = false)
    @Schema(description = "ID")
    private String id;

    @Column(name = "USERNAME_", length = 64)
    @Schema(description = "用户名")
    private String username;

    @Column(name = "NICKNAME_", length = 64)
    @Schema(description = "昵称")
    private String nickname;

    @Column(name = "DEPT_CODE_")
    @Schema(description = "所属部门")
    @Dict(dicCode="deptCode", dicEntity = Dept.class, dicText = "deptName")
    private String deptCode;

    @Column(name = "YEAR_MONTH_")
    @Schema(description = "年月")
    private String yearMonth;

    @Column(name = "ONE_POINT_FIVE_HOURS_")
    @Schema(description = "加班1.5倍时长")
    private BigDecimal onePointFiveHours;

    @Column(name = "DOUBLE_HOURS_")
    @Schema(description = "加班2倍时长")
    private BigDecimal doubleHours;

    @Column(name = "THRICE_HOURS_")
    @Schema(description = "加班3倍时长")
    private BigDecimal thriceHours;

    @Column(name = "ATTENDANCE_HOURS_")
    @Schema(description = "出勤天数")
    private BigDecimal attendanceDays;

    @Column(name = "PERFORMANCE_SCORE_")
    @Schema(description = "考勤绩效（1分制）")
    private BigDecimal performanceScore;

    @Column(name = "MEAL_SUBSIDY_")
    @Schema(description = "餐补")
    private BigDecimal mealSubsidy;

    @Dict(dicCode = "MB_SYSTEM_YES_NO")
    @Schema(description = "是否全勤")
    @Column(name = "FULL_FLAG_")
    private String fullFlag;
}
